package com.eascs.ticket.configuration.controller;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eascs.site.page.PaginationInfo;
import com.eascs.site.page.SelectDataOption;
import com.eascs.site.view.ViewContext;
import com.eascs.ticket.common.controller.BaseMasterViewController;
import com.eascs.ticket.configuration.service.DictionarySeqService;
import com.eascs.ticket.configuration.service.DictionaryService;

@Controller
public class DictionaryViewController extends BaseMasterViewController {
	@Inject
	private DictionarySeqService dictionarySeqService;

	@Inject
	private DictionaryService dictionaryService;

	@RequestMapping("/configuration/dictionary/viewDictionarySeq")
	public String viewDictionarySeq() {
		PaginationInfo paginationInfo = new PaginationInfo(dictionarySeqService.getAllDictionaryType(), new String[] { "编码", "前缀", "开始序号", "当前序号", "初始长度", "备注" });
		ViewContext.put("paginationInfo", paginationInfo);
		return "/configuration/dictionary/viewDictionarySeq";
	}

	@RequestMapping("/configuration/dictionary/viewDictionaryType")
	public String viewDictionaryType() {
		PaginationInfo paginationInfo = new PaginationInfo(dictionaryService.getAllDictionaryType(), new String[] { "编码", "名称", "备注" });
		ViewContext.put("paginationInfo", paginationInfo);
		return "/configuration/dictionary/viewDictionaryType";
	}

	@RequestMapping("/configuration/dictionary/viewDictionaryData")
	public String viewDictionaryData() {
		PaginationInfo paginationInfo = new PaginationInfo(dictionaryService.getAllDictionaryData(), new String[] { "类型", "编码", "名称", "备注", "排序号" });
		paginationInfo.setSelectDataOptions(new SelectDataOption[] { new SelectDataOption("dictionaryType") });
		ViewContext.put("paginationInfo", paginationInfo);
		return "/configuration/dictionary/viewDictionaryData";
	}
}
